var { initObj, formatObj } = require('../libs/common');

var init = function (data) {
    return initObj(mod, data);
}

var format = function (data) {
    return formatObj(mod, data);
}

// user登录凭据记录表
var mod = {
    openid: {
        name: '用户凭证',
        type: 'string',
        length: 250
    },
    appcode: {
        name: '用户凭证',
        type: 'date'
    },
    unionid: {
        name: '微信平台用户标识id',
        type: 'string',
        length: 250
    },
    session_key: {
        name: '用户回话id',
        type: 'string',
        length: 250
    },
    token: {
        name: '登录态',
        type: 'string',
        length: 250
    },
    pcode: {
        name: '用户code',
        type: 'string',
        length: 12
    },
    remarks: {
        name: '备注',
        type: 'string',
        length: 250
    },
    createtime: {
        name: '创建时间',
        type: 'date',
        default: new Date()
    },
    updatetime: {
        name: '更新时间',
        type: 'date',
        default: new Date()
    }
};

module.exports = {
    init,
    format
};